﻿<Window x:Class="Avalon.Main"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Main" Height="700" Width="1000" WindowStartupLocation="CenterScreen" WindowState="Normal"
        WindowStyle="None" BorderThickness="0" AllowsTransparency="True" Background="Transparent">
    <Window.Resources>
        <ResourceDictionary Source="E:\Avanlon\Avanlon\Resources\Main_RD.xaml"></ResourceDictionary>       
    </Window.Resources>
    <Grid Width="Auto" Height="Auto" Background="AntiqueWhite" ShowGridLines="True" Name="LayoutRoot" MouseDown="LayoutRoot_MouseDown">
        <Grid.Resources>
            <Style x:Key="RoundBorder" TargetType="Border">
                <Setter Property="BorderBrush" Value="Blue"/>
                <Setter Property="BorderThickness" Value="1,1,1,0"/>
                <Setter Property="Height" Value="90" />
                <Setter Property="Width" Value="Auto" />
            </Style>
            <LinearGradientBrush x:Key="TopBackColor" StartPoint="0.5,0" EndPoint="0.5,1">
                <GradientStop Color="#1269A3" Offset="0.05" />
                <GradientStop Color="#1685C7" Offset="0.50" />
                <GradientStop Color="#1B93D5" Offset="0.90" />
            </LinearGradientBrush>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="90"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="30"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Border CornerRadius="10,10,0,0" Background="{StaticResource TopBackColor}" Grid.ColumnSpan="2" Grid.Row="0" Style="{StaticResource RoundBorder}">
            <Grid Width="1000" Height="90" Margin="0,0,0,0" Background="Transparent">
                <Grid.RowDefinitions>
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="120"/>
                </Grid.ColumnDefinitions>
                <ListBox Style="{DynamicResource ListBox}" ItemsSource="{Binding Source={StaticResource Top_Navigation_Data}, XPath=Icon}"  HorizontalAlignment="Left"
                     SelectionChanged="ListBox_SelectionChanged" Grid.Row="0" Grid.Column="0"/>
                <Canvas Grid.Column="1" Grid.Row="0" Margin="0,0,0,0" Width="125" Background="Transparent">
                    <Canvas.Resources>
                        <Style x:Key="Set_Command_Border" TargetType="Border">
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="Width" Value="30"/>
                            <Setter Property="Height" Value="20"/>
                            <Setter Property="CornerRadius" Value="5,0,0,5"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                <GradientStop Color="#1269A3" Offset="0.05" />
                                                <GradientStop Color="#1685C7" Offset="0.50" />
                                                <GradientStop Color="#1B93D5" Offset="0.90" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                        <Style x:Key="Command_Border" TargetType="Border">
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="Width" Value="30"/>
                            <Setter Property="Height" Value="20"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                <GradientStop Color="#1269A3" Offset="0.05" />
                                                <GradientStop Color="#1685C7" Offset="0.50" />
                                                <GradientStop Color="#1B93D5" Offset="0.90" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                        <Style x:Key="Close_Command_Border" TargetType="Border">
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="Width" Value="30"/>
                            <Setter Property="Height" Value="20"/>
                            <Setter Property="CornerRadius" Value="0,20,0,0"/>
                            <Style.Triggers>
                                <Trigger Property="IsMouseOver" Value="true">
                                    <Setter Property="Background">
                                        <Setter.Value>
                                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                <GradientStop Color="#803941" Offset="0.05" />
                                                <GradientStop Color="#5D4258" Offset="0.50" />
                                                <GradientStop Color="#55445D" Offset="0.90" />
                                            </LinearGradientBrush>
                                        </Setter.Value>
                                    </Setter>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                        <ControlTemplate x:Key="Set_Command_Border_Template" TargetType="Button">
                            <Canvas>
                            <Border Style="{StaticResource Set_Command_Border}">
                                <StackPanel Height="20">
                                    <Path Stroke="#A3C5DB" Fill="#A3C5DB" Data="M 9,5 L 21,5" />
                                    <Path Stroke="#A3C5DB" Fill="#A3C5DB" StrokeThickness="1" Data="M 10,2 L 20,2 L 15,7 z" Margin="0"/>
                                </StackPanel>
                            </Border>
                                <Border Width="1" Height="10" Canvas.Top="0" Canvas.Left="30">
                                    <Border.Background>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                            <GradientStop Color="#0A507D" Offset="0.05" />
                                            <GradientStop Color="#186191" Offset="0.90" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </Canvas>
                        </ControlTemplate>
                        <ControlTemplate x:Key="Min_Command_Border_Template" TargetType="Button">
                            <Canvas>
                                <Border Style="{StaticResource Command_Border}">
                                    <StackPanel Height="20">
                                        <Path Stroke="#A3C5DB" Fill="#A3C5DB" Data="M 10,10 L 20,10" StrokeThickness="2"/>
                                    </StackPanel>
                                </Border>
                                <Border Width="1" Height="10" Canvas.Top="0" Canvas.Left="30">
                                    <Border.Background>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                            <GradientStop Color="#0A507D" Offset="0.05" />
                                            <GradientStop Color="#186191" Offset="0.90" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </Canvas>
                        </ControlTemplate>
                        <ControlTemplate x:Key="Max_Command_Border_Template" TargetType="Button">
                            <Canvas>
                                <Border Style="{StaticResource Command_Border}">
                                    <Canvas>
                                        <Border BorderBrush="#A3C5DB" BorderThickness="1,3,1,1" Width="11" Height="10" Canvas.Left="10" Canvas.Top="4"/>
                                    </Canvas>
                                </Border>
                                <Border Width="1" Height="10" Canvas.Top="0" Canvas.Left="30">
                                    <Border.Background>
                                        <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                            <GradientStop Color="#0A507D" Offset="0.05" />
                                            <GradientStop Color="#186191" Offset="0.90" />
                                        </LinearGradientBrush>
                                    </Border.Background>
                                </Border>
                            </Canvas>
                        </ControlTemplate>
                        <ControlTemplate x:Key="Close_Command_Border_Template" TargetType="Button">
                            <Canvas>
                                <Border Style="{StaticResource Close_Command_Border}">
                                    <Canvas>
                                        <Path Stroke="#A3C5DB" StrokeThickness="2" Data="M17,5 L7,13" />
                                        <Path Stroke="#A3C5DB" StrokeThickness="2" Data="M7,5 L17,13" />
                                    </Canvas>
                                </Border>
                            </Canvas>
                        </ControlTemplate>
                    </Canvas.Resources>
                    <Border Canvas.Top="0" BorderBrush="#0A507D" BorderThickness="1" Width="125" CornerRadius="5,10,0,5">
                        <StackPanel Orientation="Horizontal">
                            <Button Width="30" Height="20" Margin="0" Name="Set_Command"  Template="{StaticResource Set_Command_Border_Template}"/>
                            <Button Width="30" Height="20" Margin="1,0,0,0" Name="Min_Command" Template="{StaticResource Min_Command_Border_Template}"/>
                            <Button Width="30" Height="20" Margin="1,0,0,0" Name="Max_Command" Template="{StaticResource Max_Command_Border_Template}"/>
                            <Button Width="30" Height="20" Margin="1,0,0,0" Name="Close_Command" Template="{StaticResource Close_Command_Border_Template}" Click="Close_Command_Click"/>
                        </StackPanel>
                    </Border>
                </Canvas>
            </Grid>
        </Border>
    </Grid>
</Window>
